home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr33
/
input22.zip
/
INPUT.DOC
< prev
next >
Wrap
Text File
|
1993-04-16
|
21KB
|
489 lines
STEENBURGH'S STUFF
Mildly Useful Utilities
For Batch Files
Version 2.51
Copyright 1991-1993 by Chuck Steenburgh and Tay-Jee Software
_______
____|__ | (TM)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
Page 1
INPUT.EXE v2.2 |
Copyright 1991-1993 by Chuck Steenburgh & Tay-Jee Software
If you use batch files very often, you've probably acquired
a program called ASK.COM or QUERY.COM or something similar
that allows you to ask questions and receive simple responses.
Usually, this involves typing an ECHO command with your
question, followed by ASK.COM or whatever. If you do this
a lot, you will probably appreciate the fact the INPUT.EXE
will accomplish the jobs of both the ECHO and ASK commands.
Add to this the greater flexibility that INPUT.EXE offers
in presenting your prompt to the user and in receiving input,
and you'll be sold.
Usage: INPUT ["prompt"] [nnn] [Options]
"prompt" Enter the text you would like to
appear to prompt the user for
input. This can be up to 59 char-
acters and must be enclosed in
quotation marks.
nnn Enter a number representing the
color in which you want your mes-
sage to appear. You must, of
course, have a color monitor and
card. See Appendix 3.
Options:
/C Include this switch if you want
your prompt message centered on
the current line. If you include
this switch, you MUST include a
color value.
/D Display list of available disk drives
on current system and restrict input
to one of these letters.
/Exxxxxx Instead of returning errorlevel, ac-
cept text input which is supplied to
command "xxxxxx."
/H or /? Display brief help screen.
/I Use this for a case-insensitive error
level return. If this switch is
included on the command line, pressing
a letter a-z (lower case) will return
the same value as if the corresponding
key A-Z (upper case) were pressed.
Page 2
/Ln Leftmost column in which prompt should
appear.
/Mxxxxxx Receive text input and set environment
variable xxxxxx with data received.
Defaults to variable name of INPUT if |
no name is provided. |
/Pd Pause 10 seconds for user input, then
default to "d" (where "d" is any char-
acter. INPUT will wait up 10 seconds
for user input. If no key is pressed
within 10 seconds, INPUT will act as
if the key specified by the key rep-
resented by the single character "d"
was pressed. Note that all other
switches (case insensitivity, yes/no
answer, etc.) remain active if time
expires and the default key is used.
INPUT adds a warning that it will de-
fault to the specified value after 10
seconds, and will display a succession
of ten dots to indicate elapsed time.
/Q Quiet mode. Suppresses the audible
alarm prompt.
/R Row in which prompt should appear.
/S Show keypress. Adding this switch
will cause INPUT to display the
errorlevel value returned. Use this
for quick "debugging" of your use
of INPUT.EXE
/V Instead of a single keypress, causes
INPUT to read a numeric value (con-
cluded with a carriage return) between
0 and 255 from the keyboard. Values
less than 0 will return 0 and values
greater than 255 will return 255.
/Wn When used in conjunction with the /P
switch, changes the default wait time
to n seconds, where n is no greater
than 999 seconds.
/X When used in conjunction with the /W
and/or /P switches will suppress dis-
play of the default value and timer
"ticks."
/Y Use this for a yes-no only response.
If the "n" key is pressed, errorlevel
Page 3
of "0" is returned; pressing any other
key returns an errorlevel of 1. The
prompt "(Y/n)" is appended to the nor-
mal prompt specified by the user.
/N Use this for a yes-no only response.
If the "y" key is pressed, errorlevel
of "1" is returned; pressing any other
key returns an errorlevel of 0. The
prompt "(y/N)" is appended to the nor-
mal prompt specified by the user.
This switch takes precedence over the
/y switch.
The command line parameters may be entered in any
order, may be in any case, and may be preceded by
either the "/" or "-" character.
Examples:
INPUT "Select a number from one to 10"
This prints the text "Select on number from one to 10"
on the current line and waits for a keypress.
INPUT "Press any key to continue" 79
This prints the text "Press any key to continue" on the
current line in bright white on a red background and waits
for a keypress.
INPUT "Press the space bar to exit" 143 /c
This prints the text "Press the space bar to exit" cen-
tered on the current line in flashing bright white on a black
background.
INPUT /s /i "Press any key..." /c 14
Prompts user with "Press any key..." in yellow on black.
Returns a case-insensitive errorlevel and displays it on the
screen before terminating.
INPUT "Do you wish to continue?" /s 79 /y
Prompts user with "Do you wish to continue? (Y/n)" in
white on red. Returns errorlevel of 1 unless the "n" key is
pressed. Displays errorlevel on screen.
INPUT "Press any key..." /pf
Prompts user with "Press any key... (defaults to f after
10 seconds)" in black on white. Returns errorlevel of 102 if
no key is pressed within 10 seconds, otherwise returns value of
Page 4
key pressed.
INPUT "Press any key..." /c /pf
Prompts user with "Press any key... (defaults to f after
10 seconds)" in black on white. Returns errorlevel of 70 if no
key is pressed within 10 seconds, otherwise returns the upper
case ASCII value of the key pressed.
INPUT "Enter data:" /p1 /w15 /q 30
Prompts user with "Enter data: (defaults to 1 after 15
seconds)" in yellow on blue. Returns errorlevel of 49 if no
key is pressed after 15 seconds, otherwise returns the error-
level of the key pressed. The alarm does NOT sound.
INPUT "How many copies should be printed? " /v /c
Prompts user with "How many copies should be printed?"
centered on the current line. A number can be entered by the
user and INPUT will return an errorlevel equal to the number
entered (between 0 and 255). If the /V switch is used, the
data entered by the user will appear on screen, and can be
changed using backspace before pressing <Return>.
INPUT "Press any key to continue..." /p /x
Displays the familiar DOS PAUSE message, but exits after
a 10 second delay if no key is pressed. An errorlevel of 0 is
returned.
INPUT "Switch to which drive?" /D
Displays prompt "Switch to which drive?" followed by a
list of all valid drives on the system. Will not exit until
one of these drive letters is pressed.
INPUT "Enter a directory mask " /Edir /C
Centers prompt "Enter a directory mask " on screen. Exe-
cutes DOS "dir" command, using any text entered in response to
prompt as arguments. For example, if user typed "*.exe /p" the
command "dir *.exe /p" will be executed by INPUT. This allows
INPUT to be used to enter limited string data.
INPUT "Enter a file name: " /Wfilename
Accepts text data from keyboard and places value entered
in the master environment in a variable named "filename." This
value can later be accessed within a batch file or via other
programs.
INPUT will also sound an alarm to let the user know that
a response is expected (unless /Q switch specified).
Page 5
When a key is pressed, INPUT will set the errorlevel equal
to the ASCII value of the key pressed. This is slightly dif-
ferent from BATBOX in that in normal operation INPUT is case
sensitive and will allow you to distinguish between upper and
lower case letters. If you want a case-insensitive return, use
the /i switch. See Appendix 2 for a complete list of the ASCII
characters theoretically supported by INPUT. If the /H or /?
parameter was specified, the errorlevel returned will be 255.
If you want greater control over the placement of your prompt
message on the screen, use WRITE in conjunction with INPUT.
Use WRITE to display your prompt then use INPUT without the
"prompt," color, or /c parameters.
When using the /E parameter to execute a batch file, be sure
to include the extension ".BAT" as part of the switch.
When using the /M switch to set an environment variable, the
variable name you supply will be converted to upper case. DOS
will only recognize upper case variables within batch files.
When using the /M switch in conjunction with /Y or /N, the |
variable will be assigned a value of YES or NO as appropriate. |
SPECIAL NOTE TO 4DOS* USERS
INPUT.EXE conflicts with 4DOS' INPUT internal command. To
remedy this situation, create a batch file containing the two
lines below (or add them to your AUTOEXEC.BAT file) and execute
once each time your computer is turned on:
alias input d:\path\input.exe
alias inp4 *input
The first line creates an alias of "input" for the program
INPUT.EXE. The second line creates an alias of "inp4" for the
internal 4DOS INPUT command. Make sure the "d:\path\" part of
the first line is replaced with the actual drive/path in which
INPUT.EXE is located on your system. Since INPUT v2.11 performs
many more functions than the 4DOS command, it is desirable to
avoid any confusion and simply replace 4DOS' INPUT command.
* 4DOS is a registered trademark of JP Software Inc.
OMBUDSMAN
This program is produced by a member of the Association of
Shareware Professionals (ASP). ASP wants to make sure that
the shareware principle works for you. If you are unable to
resolve a shareware-related problem with an ASP member by
contacting the member directly, ASP may be able to help. The
ASP Ombudsman can help you resolve a dispute or problem with
Page 6
an ASP member, but does not provide technical support for
members' products. Please write to the ASP Ombudsman at 545
Grover Road, Muskegon, MI 49442 or send a CompuServe message
via CompuServe Mail to ASP Ombudsman, 70007,3536.
DISCLAIMER
The programs described in this documentation are guaran-
teed to do absolutely nothing! They have, however, in my exper-
ience performed essentially as described herein. The author
will not be responsible for any loss or damages caused through
the use of these programs. No warranty, express or implied,
is provided for this software's performance, merchantability,
or fitness for a particular purpose.
All trademarks are property of their respective owners.
The programs and documentation are Copyright 1991,1992 by
Chuck Steenburgh. You are encouraged to distribute these pro-
grams provided the following conditions are met:
- all files contained in the archive or distribution disk
must be distributed together in UNMODIFIED form
- you charge no more than a reasonable fee for copying or
subscription, and clearly indicate that payment of such
a fee does NOT grant ownership of the programs.
This program is part of set of utilities known as STEEN-
BURGH'S STUFF (Mildly Useful Utilities). The full set of
utilities includes the following programs:
BATBOX: Simple menu creation/input system
CHKDRV: Checks disk drive status
CHKPRN: Checks parallel printer status
CLK: Displays time on screen
CURSOR: Change cursor shape
DOSVER: Checks for DOS version currently running
INPUT: Simple prompt/input system
KLS: Colorful screen-clearing utility
LAUNCHER: File selection/execution system
MUSIC: Plays transcribed sheet music on the PC
RAND: Random number generator
SKIP: Prints blank lines from batch files
SOUNDER: Wide range of noise making options
SPACE: File/disk space reporting utility
WAITFOR: Timed pauses
WHENISIT: Date/time telling utility
WRITE: Colorful output anywhere on screen
XD: Create/switch directories at the same time
You may evaluate these programs for up to 30 days on a free
trial basis. After 30 days, you should register your use of
Page 7
these programs. The registration fee is $20, payable to the
author at the address given below. For those registering
directly with Tay-Jee Software, we offer a $5 cash discount.
Let's be real: I don't plan to make a lot of money this way.
Registration does have its advantages:
- I am improving these programs all the time. Registration
will get you IMMEDIATELY a disk with the latest version.
You will also get the next major release of the program set
sent to you free of charge.
- While I can't promise to include everyone's suggestions
in program updates, you can bet I'll listen to registered
users before any of you scrounges out there.
- You will make me feel all warm and fuzzy and appreciated,
and all that good stuff.
- You will also get an evaluation copy of my text file for-
matting program (used to produce the margins in this doc-
ument), and any other electronic creations I have decided
to unleash on a foolish, unsuspecting world.
Send comments/registrations to:
Tay-Jee Software
Post Office Box 835
Lexington, VA 24450
(703)464-5290
!!!VIRGINIA RESIDENTS ADD 4.5SALES TAX!!!
CIS 72330,1776 (I haunt the IBMSYS and IBMPRO forums)
Page 8